#ifndef MOTIONDETECTOR_H
#define MOTIONDETECTOR_H

#include <iostream>
#include <string>
#include <vector>

class MotionDetector
{
  public:
    virtual ~MotionDetector() = default;

    // 表示敌方车辆当前的运动状态
    enum class MotionStatus
    {
        UB = -1,                  // 初始未知状态
        Unknown,                  // 无法判定
        Translating,              // 线性平移
        RotatingClockwise,        // 顺时针旋转
        RotatingCounterClockwise, // 逆时针旋转
        TranslatingAndRotating,   // 旋转加平移
        Stationary                // 静止
    };

    static std::string toString(MotionDetector::MotionStatus status)
    {
        switch (status)
        {
        case MotionStatus::UB:
            return "UB";
        case MotionStatus::Unknown:
            return "Unknown";
        case MotionStatus::Translating:
            return "Translating";
        case MotionStatus::RotatingClockwise:
            return "RotatingClockwise";
        case MotionStatus::RotatingCounterClockwise:
            return "RotatingCounterClockwise";
        case MotionStatus::TranslatingAndRotating:
            return "TranslatingAndRotating";
        case MotionStatus::Stationary:
            return "Stationary";
        default:
            return "InvalidStatus";
        }
    }

    virtual bool detect(const std::vector<float> &yaw_data, MotionStatus &out_status) = 0;
};

inline std::ostream &operator<<(std::ostream &os, MotionDetector::MotionStatus status)
{
    return os << MotionDetector::toString(status);
}

#endif // MOTIONDETECTOR_H